<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://paycn.com.cn/pos" prefix="p" %>

<div class="container-fluid">
	<div class="row-fluid">
		<div class="span12">
			<h3 class="page-title">机构信息管理</h3>
			<ul class="breadcrumb">
				<li>
					<i class="icon-home"></i>
					<a href="<c:url value="/home.html"/>">首页</a> 
					<i class="icon-angle-right"></i>
				</li>
				<li><a href="#">机构信息管理</a></li>
			</ul>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span12">
			<c:choose>
				<c:when test="${messageError!=null }">
					<div class="alert alert-error">
						<strong>失败!</strong> ${messageError }
					</div>
				</c:when>
				<c:when test="${messageSuccess!=null }">
					<div class="alert alert-success">
						<strong>成功!</strong> ${messageSuccess }
					</div>
				</c:when>
			</c:choose>
			<div class="portlet">
				<div class="portlet-title">
					<div class="caption"><i class="icon-search"></i> 查询</div>
					<div class="tools">
						<a href="javascript:;" class="collapse"></a>
					</div>
				</div>
				<div class="portlet-body" >
					<form action="<c:url value='/unit/query.html'/>" method="get" class="form-inline">
						<div class="row-fluid">
							<div class="span2 query">
								<div class="control-group">
									<label class="control-label">机构编码</label>
									<div class="controls">
										<input type="text" name="unitCode" value="${param.unitCode}" class="m-wrap span12">
									</div>
								</div>
							</div>
							<div class="span2 query">
								<div class="control-group">
									<label class="control-label">选择省份</label>
									<div class="controls">
										<select class="m-wrap span12" name="provinceName">
											<option value="" selected="selected">-</option>
											<c:forEach items="${regionList}" var="reg">
												<option value="${reg.region}" <c:if test="${reg.region == param.provinceName}">selected="selected"</c:if> >${reg.region}</option>
											</c:forEach>
										</select>
									</div>
								</div>
							</div>
							<div class="span2 query">
								<div class="control-group">
									<label class="control-label">机构状态</label>
									<div class="controls">
										<select class="m-wrap span12" name="status">
											<option value="" selected="selected">-</option>
											<option value="INV" <c:if test="${param.status == 'INV'}">selected="selected"</c:if> >未生效</option>
											<option value="EFF" <c:if test="${param.status == 'EFF'}">selected="selected"</c:if> >已生效</option>
											<option value="EXT" <c:if test="${param.status == 'EXT'}">selected="selected"</c:if> >已退场</option>
										</select>
									</div>
								</div>
							</div>
							<div class="span2 query">
								<div class="control-group">
									<label class="control-label">&nbsp;</label>
									<div class="controls">
										<button type="submit" class="btn blue purple-stripe"><i class="icon-search"></i> 查询</button>
									</div>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span12">
			<div class="portlet box grey">
				<div class="portlet-title">
					<div class="caption"><i class="icon-bookmark"></i> 机构信息列表</div>
					<div class="actions">
						<a class="btn green" href="<c:url value="/unit/add.html"/>"><i class="icon-plus"></i> 添加机构</a>
					</div>
				</div>
				<div class="portlet-body no-more-tables">
					<table class="table table-bordered table-striped table-hover flip-content">
						<thead>
							<tr>
								<th>机构编号</th>
								<th>机构名称</th>
								<th>机构简称</th>
								<th>所处区域</th>
								<th>机构状态</th>
								<th>机构电话</th>
								<th>申请人</th>
								<th>申请日期</th>
								<th>业务联系人</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${dataGrid.rows}" var="rows">
								<tr>
									<td data-title="机构编号">${rows.unitCode}&nbsp;</td>
									<td data-title="机构名称">${rows.unitName}&nbsp;</td>
									<td data-title="机构简称">${rows.unitAlias}&nbsp;</td>
									<td data-title="所属区域">${rows.provinceName}${rows.cityName}${rows.countyName}&nbsp;</td>
									<td data-title="机构状态">
										<c:if test="${rows.status == 'INV'}">未生效</c:if>
										<c:if test="${rows.status == 'EFF'}">已生效</c:if>
										<c:if test="${rows.status == 'EXT'}">已关闭</c:if>&nbsp;
									</td>
									<td data-title="机构电话">${rows.unitTel}&nbsp;</td>
									<td data-title="申请人">${rows.applicant}&nbsp;</td>
									<td data-title="申请日期"><fmt:formatDate value="${rows.applyDate}" pattern="yyyy-MM-dd HH:mm:ss" />&nbsp;</td>
									<td data-title="业务联系人">${rows.busName}&nbsp;</td>
									<td data-title="操作">
										<a href="<c:url value="/unit/${rows.unitCode}/edit.html"/>" class="btn mini blue"><i class="icon-zoom-in"></i> 修改</a>
										<a href="<c:url value='/unit/${rows.unitCode}/detail.html'/>" class="btn mini green"><i class="icon-zoom-in"></i> 查看</a>
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<p:pagination url="/unit/query.html" total="${dataGrid.total}"/>
				</div>
			</div>
		</div>
	</div>
</div>